package top.abilities.util.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author dong
 * @date 2019-06-20 14:38
 */
@Component
public class PropertieUtils {
    @Autowired
    private Environment env;

    private static Environment staticEnv;

    @PostConstruct
    public void initEnv(){
        staticEnv=env;
    }

    public static String getValue(String key){
        return staticEnv.getProperty(key);
    }
}
